package facede

import (
	"context"
	"ginfwk/infrastructure/component/cache"
	di "github.com/samber/do"
)

func CtxCache(ctx context.Context) cache.Cache {
	ctxLogger := CtxLogger(ctx)

	currentCache, err := di.Invoke[cache.Cache](nil)
	if err != nil {
		panic(err)
	}
	return currentCache.CtxCache(ctx, ctxLogger)
}
